<template>
  <div class="login-page-wrapper">
    <div class="footer-bar">
      <div class="footer-content"></div>
      <div class="footer-intro">仙玩信息云手机平台，仙玩信息云手机平台，仙玩信息云手机平台，仙玩信息云手机平台，仙玩信息云手机平台。</div>
    </div>
    <div class="container">
      <div class="row">
        <diV class="col-md-8 intro-container">
          <h4 class="title">集控部署,一台电脑控制上万台云手机</h4>
          <h4 class="title">集控部署,一台电脑控制上万台云手机</h4>
          <h4 class="title">集控部署,一台电脑控制上万台云手机</h4>
          <h4 class="title">集控部署,一台电脑控制上万台云手机</h4>
        </diV>
        <diV class="col-md-4 login-container">
          <div class="login-box">
            <div class="login-tips">
              <div class="title">账号登录</div>
              <div class="tip">建议使用Chrome浏览器操作仙玩云手机系统</div>
            </div>
            <div class="login-form">
              <form class="form-horizontal">
                <div class="form-group">
                  <input
                    class="form-control"
                    type="text"
                    v-model="loginInfo.username"
                    placeholder="手机号/邮箱地址"
                  >
                </div>
                <div class="form-group">
                  <input
                    class="form-control"
                    type="password"
                    v-model="loginInfo.password"
                    placeholder="密码"
                  >
                </div>
                <button type="button" class="btn btn-primary btn-block" @keyup.enter="login()" @click="login()">登录</button>
                <div class="form-group red" v-if="errorTip">{{errorTip}}</div>
              </form>
            </div>
            <div class="login-footer">
              <span class="forget" @click="toForget()">忘记密码?</span>
              <span class="dotted">|</span>
              <span class="register" @click="toRegister()">账号注册</span>
            </div>
          </div>
        </diV>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      errorTip: "",
      loginInfo: {
        username: "",
        password: ""
      }
    };
  },
  created() {
    // console.log(this._http.get('/pms/1/stat/costFlowInfo?sFundType=2&t=1545980561154&token=admin'))
  },
  methods: {
    //登录
    login() {
      this.loginInfo.username = _.trim(this.loginInfo.username);
      this.loginInfo.password = _.trim(this.loginInfo.password);
      console.log(this.loginInfo);
      if (this.loginInfo.username == "" && this.loginInfo.password == "") {
        this.errorTip = "请输入账号和密码";
        return 0;
      }
      if (this.loginInfo.username == "") {
        this.errorTip = "请输入账号";
        return 0;
      }
      if (this.loginInfo.password == "") {
        this.errorTip = "请输入密码";
        return 0;
      }
      this.$router.push({ path: "/pages" });
    },
    //忘记密码
    toForget() {
      this.$router.push({ path: "/forget" });
    },
    //注册账号
    toRegister() {
      this.$router.push({ path: "/register" });
    }
  }
};
</script>

<style lang="scss" scoped>
$white-light: #f5f5f5;
$primary-shadow: rgba(82, 168, 236, 0.6);
.login-page-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 700px;
  padding-top: 8%;
  overflow: auto;
  background-color: $primary-shadow;
  // background: url(require("../../static/img/background.png")) no-repeat;
  // background-size: 100% 100%;
  // background-attachment: fixed;
}
.login-box {
  position: relative;
  vertical-align: middle;
  background-color: #fff;
  padding: 35px 40px 28px;
  box-shadow: 0px 0px 10px $white-light;
}
.login-tips {
  position: relative;
  margin: 0 auto 26px;
  z-index: 11;
  font-size: 16px;
  color: #666;
  .title {
    font-size: 18px;
    margin-bottom: 30px;
  }
  .tip {
    font-size: 13px;
    color: #73777a;
  }
}
.form-horizontal {
  height: 230px;
  .form-group {
    position: relative;
    margin-bottom: 20px;
    .form-control {
      padding: 5px 4px;
      height: 34px;
      font-size: 12px;
    }
  }
  .btn-block {
    height: 34px;
  }
}
.login-footer {
  position: absolute;
  height: 34px;
  bottom: 0;
  right: 40px;
  text-align: right;
  .forget,
  .register {
    cursor: pointer;
    font-size: 14px;
    color: #333;
  }
  .dotted {
    color: #bfbfbf;
    margin: 0 5px;
  }
}
.footer-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 360px;
  // background-color: blue;
  .footer-intro {
    position: absolute;
    width: 100%;
    height: 20px;
    bottom: 0;
    text-align: center;
    line-height: 20px;
    color: #fff;
    background-color: red;
  }
}
</style>